import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueAxios from 'vue-axios'
import element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import store from './store.js'
import axios from 'axios'
Vue.config.productionTip = false

axios.defaults.timeout = 30000;//设置超时时间
axios.interceptors.request.use(
    config => {
      // console.log(config);
      if (localStorage.getItem("token")) {
        config.headers.token = localStorage.getItem("token");
        //把localStorage的token放在token里
      }
      return config;
    },
    function(err) {
      console.log("失败信息" + err);
    }
);

Vue.use(VueAxios,axios)
Vue.use(element)

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
